<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

/**
 * version控制器
 */
class Version extends AdminBase
{
    
    /**
     * version列表
     */
    public function versionList()
    {
        
        $where = $this->logicversion->getWhere($this->param);
        
        $this->assign('list', $this->logicversion->getversionList($where, 'a.*', 'a.create_time desc'));
        
        return $this->fetch('version_list');
    }
    
    /**
     * version添加
     */
    public function versionAdd()
    {
        
        $this->versionCommon();
        
        return $this->fetch('version_edit');
    }
    
    /**
     * version编辑
     */
    public function versionEdit()
    {
        
        $this->versionCommon();
        
        $info = $this->logicversion->getversionInfo(['a.id' => $this->param['id']], 'a.*');

        
        $this->assign('info', $info);
        
        return $this->fetch('version_edit');
    }
    
    /**
     * version添加与编辑通用方法
     */
    public function versionCommon()
    {
        
        IS_POST && $this->jump($this->logicversion->versionEdit($_POST));
        

    }
    


    

    /**
     * 数据状态设置
     */
    public function setStatus()
    {
        
        $this->jump($this->logicAdminBase->setStatus('version', $this->param));
    }
}
